<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<div *ngIf="noresults" style="text-align: center;font-size: 26px;margin-top: 20%">
  <b>No content</b>
</div>

<div *ngIf="!noresults" id="bigChartContainer" class="big-chart-container" (window:resize)="onResize($event)"
     style="display:none;">
  <div id="bigChartShow" class="big-chart-content">
    <div class="container-fluid">
      <div class="row">
        <a (click)="showDownloadSample()" style="font-size:15px;margin:30px 30px;"><u>Download Miss Sample</u></a>
      </div>
      <div class="row">
        <div id="bigChartDiv" echarts [options]="chartOption"></div>
      </div>
    </div>
  </div>
</div>
<div *ngIf="profiling && !noresults" id="table-scroll" class="table-scroll">
  <b class="title">{{this.prodata[0].name}}</b>
  <div class="table-wrap">
    <table class="main-table y-scrollable" [mfData]="prodata" #mf="mfDataTable" [mfRowsOnPage]="18">
      <thead>
      <tr style="background-color:#7D95CC">
        <th class="fixed-side" scope="col" style="background-color:#7D95CC">Time</th>
        <th class="cover" scope="col">Time</th>
        <th scope="col" *ngFor="let name of this.columnname" style="text-align: center;">{{name}}</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let item of mf.data">
        <th class="fixed-side">{{(item.tmst | date: 'yyyy/MM/dd HH:mm:ss') || 'N/A' }}</th>
        <th class="cover">{{(item.tmst | date: 'yyyy/MM/dd HH:mm:ss') || 'N/A' }}</th>
        <td *ngFor="let key of objectKeys(item.value)">{{item.value[key]}}</td>
      </tr>
      </tbody>
      <tfoot>
      <tr>
        <td class="text-center" colspan="8" style="background-color:#1f1f1f;position: fixed;margin-left: 30%;"
            id="pagination">
          <mfBootstrapPaginator></mfBootstrapPaginator>
        </td>
      </tr>
      </tfoot>
    </table>
  </div>
</div>

<div class="modal fade" id="downloadSampleModal" role="dialog" tabindex="-1" [ngClass]="{'in': visibleAnimate}"
     *ngIf="missRecordList" [ngStyle]="{'display': visible ? 'block' : 'none', 'opacity': visibleAnimate ? 1 : 0}"
     (click)="onContainerClicked($event)">
  <div class="modal-dialog modal-md modal-md">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <toaster-container></toaster-container>
        <h4 class="modal-title">{{currentJob}} job miss records timestamp list</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid" id="dowloadContent" style="overflow:auto;">
          <tr>
            <td colspan="7" style="padding:20px 30px 10px 30px;">
              <table class="table table-striped" style="border-spacing: 15px;" [mfData]="missRecordList" #mf2="mfDataTable" [mfRowsOnPage]="10">

                <tbody>
                <tr *ngIf="!missRecordList">
                  <td colspan="7" style="text-align:center">No content.</td>
                </tr>
                <!-- <tr *ngFor="let item of mf2.data">
                  <td style="background-color:black;"><a (click)="downloadSample(item)">{{item.tmst}} {{item.tmst |
                    date: 'yyyy/MM/dd HH:mm:ss'}}</a></td>
                </tr> -->
                <div *ngFor="let item of mf2.data; let isEven = even;let i = index;let isLast= last">
                 <tr *ngIf="isEven && !isLast">
                   <td style="background-color:black; cursor: pointer;" nowrap><a [ngClass]="{'adisabled': !isDownloadClickDisabled}" (click)="downloadSample(item)" style="margin: 15px 15px 15px 15px;">{{mf2.data[i].tmst}} {{mf2.data[i].tmst |
                     date: 'yyyy/MM/dd HH:mm:ss'}}</a></td>
                   <td style="background-color:black; cursor: pointer;" nowrap><a [ngClass]="{'adisabled': !isDownloadClickDisabled}" (click)="downloadSample(item)">{{mf2.data[i+1].tmst}} {{mf2.data[i+1].tmst |
                     date: 'yyyy/MM/dd HH:mm:ss'}}</a></td>
                   </tr>
                 </div>
                </tbody>
                <tfoot>
                <tr>
                  <td class="text-center" colspan="8" style="background-color:#1f1f1f;" id="paginationdownlad">
                    <mfBootstrapPaginator></mfBootstrapPaginator>
                  </td>
                </tr>
                </tfoot>
              </table>
            </td>
          </tr>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" (click)="hide()">Back</button>
      </div>
    </div>
  </div>
</div>
